<template>
    <router-view />
</template>
<script lang="ts">
import { Component, Vue } from "vue-property-decorator";
import { CommonModule } from "@/store/modules/commonModules";
import { generateRoutes, platformRoute } from "@/router";
@Component({
    name: "tpl",
    components: {},
})
export default class extends Vue {
    created() {
        CommonModule.setPageType("platform");
        if (this.$route.path === "/platform" || this.$route.path === "/platform/" ) {
            const routes = generateRoutes(platformRoute.children);
            let nowRoutes:any = null;
            let firstRoute:any = null;
            firstRoute = routes[0];
            if (firstRoute.children && firstRoute.children.length > 0) {
                nowRoutes = firstRoute.children[0];
            } else {
                nowRoutes = firstRoute;
            }
            this.$nextTick(() => {
                this.$router.replace({ name: nowRoutes.name });
            });
        }
    }
}
</script>
